import _axios from "@/plugins/axios";

/**
 * 支付结果查询
 * @param payOrderId string 单号
 */
export function getResultPayment(params) {
    return _axios({
        url: '/payment/queryPayStatusByPayOrderId',
        method: 'get',
        params
    })
}

// 收款人信息
export function getTransferInfo(params) {
    return _axios({
        url: '/bank/transfer/info',
        method: 'get',
        params
    })
}

// 汇款分页列表
export function getTransferPage(params) {
    return _axios({
        url: '/bank/transfer/page',
        method: 'get',
        params: params
    })
}

// 提交汇款
export function getTransferSubmit({ currencyCode, id, transferAmount, transferBank, transferImage, transferName, transferNo }) {
    return _axios({
        url: '/bank/transfer/submit',
        method: 'post',
        data: {
            currencyCode, // 汇款币种编码
            id, // 汇款id
            transferAmount, // 汇款金额
            transferBank, // 汇款人银行
            transferImage, // 汇款图片
            transferName, // 汇款人姓名
            transferNo // 汇款人凭证号
        }
    })
}

// 重新提交汇款
export function getSubmitRepeat({ currencyCode, id, transferAmount, transferBank, transferImage, transferName, transferNo }) {
    return _axios({
        url: '/bank/transfer/submit/repeat',
        method: 'post',
        data: {
            currencyCode, // 汇款币种编码
            id, // 汇款id
            transferAmount, // 汇款金额
            transferBank, // 汇款人银行
            transferImage, // 汇款图片
            transferName, // 汇款人姓名
            transferNo // 汇款人凭证号
        }
    })
}


// 计算手续费
export function getTransferAmount({ amount, id, currencyCode }) {
    return _axios({
        url: '/bank/transfer/amount',
        method: 'post',
        data: {
            amount,
            id,
            currencyCode
        }
    })
}

// 支付结果查询 整合了拼团的支付接口
export function getResultBack(params) {
    return _axios({
        url: '/payment/result/query/V2',
        method: 'get',
        params: params
    })
}